Another iteration...
Pong_kenbakuino_02.txt Ardunaut AUG 31,2021 (Tested!)
Code reduction by using the "SKIP 1" instruction.
ToDo:
-Create a DISP subroutine with an included delay to run the program in any KENBAK-1
Based in Pong_kenbakuino.txt Ardunaut AUG 31,2021
---------------------------------------------------------------------------
>AS
; Pong Game for kenbakuino Ardunaut AUG 31,2021
; Using the "SKIP 1" instruction to save 2 Bytes.
; To play: Use the system CPU-Delay, (BIT5 + STOP) or (BIT4 + STOP)
ORG 002
DB 000 ; X = 000 (used to clear input)
DB 004 ; Program Counter = 004
LOAD A C=200 ; ball at start position to serve
LFT ROT A,1 ; move the ball to the left
STORE A 200 ; shows A in the display
LOAD B 000 ; A -> B
SUB B 377 ; (OUTPUT-INPUT) -> B
STORE X 377 ; clears INPUT
JPD B!=0 006 ; if (INPUT-OUTPUT) != 0 ball continues, else bounces back
RT ROT A,1 ; move the ball to the right
STORE A 200 ; shows A in the display (OUTPUT)
SKIP 1 b0 000 ; ball at start?
JPD UNC 021 ; continues bouncing back
JPD UNC 006 ; if ball is at start go to serve
Q
>O 31
Octal file:
000,000,000,004,023,200,311,034,200,124,000,114,377,234,377,143,
006,111,034,200,302,000,343,021,343,006,e
>DI 4 14
Disassembling...
004:023 200 LOAD A C=200