Execute Brain****: Difference between revisions
Content added Content deleted
m (→Interpreter: Layout: sometimes alternating line types can be converted to table style) |
|||
Line 1,495: | Line 1,495: | ||
I = I + 1 !Advance one. The classic. |
I = I + 1 !Advance one. The classic. |
||
SELECT CASE(C) !Now decode the instruction. |
SELECT CASE(C) !Now decode the instruction. |
||
CASE(">") !Move the data finger one place right. |
CASE(">"); D = D + 1 !Move the data finger one place right. |
||
D = D |
CASE("<"); D = D - 1 !Move the data finger one place left. |
||
CASE(" |
CASE("+"); STORE(D) = CHAR(ICHAR(STORE(D)) + 1) !Add one to the fingered datum. |
||
D = D - 1 |
CASE("-"); STORE(D) = CHAR(ICHAR(STORE(D)) - 1) !Subtract one. |
||
CASE(" |
CASE("."); WRITE (MSG,1) STORE(D) !Write a character. |
||
CASE(","); READ (KBD,1) STORE(D) !Read a character. |
|||
CASE(" |
CASE("["); IF (ICHAR(STORE(D)).EQ.0) CALL SEEK(+1) !Conditionally, surge forward. |
||
CASE("]"); IF (ICHAR(STORE(D)).NE.0) CALL SEEK(-1) !Conditionally, retreat. |
|||
CASE(".") !Write a character. |
|||
WRITE (MSG,1) STORE(D) |
|||
CASE(",") !Read a character. |
|||
READ (KBD,1) STORE(D) |
|||
CASE("[") !Conditionally, surge forward. |
|||
IF (ICHAR(STORE(D)).EQ.0) CALL SEEK(+1) |
|||
CASE("]") !Conditionally, retreat. |
|||
IF (ICHAR(STORE(D)).NE.0) CALL SEEK(-1) |
|||
CASE DEFAULT !For all others, |
CASE DEFAULT !For all others, |
||
!Do nothing. |
!Do nothing. |
||
END SELECT !That was simple. |
END SELECT !That was simple. |
||
END DO !See what comes next. |
END DO !See what comes next. |