Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM 



Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
CEE

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
C\BB itemtype='https://schema.org/Blog' itemscope='itemscope' class="wp-singular computer_media-template-default single single-computer_media postid-56808 wp-custom-logo wp-embed-responsive wp-theme-astra wp-child-theme-astra-child ast-desktop ast-separate-container ast-left-sidebar astra-4.12.6 group-blog ast-blog-single-style-1 ast-custom-post-type ast-single-post ast-inherit-site-logo-transparent ast-hfb-header ast-full-width-primary-header ast-box-layout ast-normal-title-enabled astra-addon-4.12.4"D\E5

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
\CB\CB\FA

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
itemtype='https://schema.org/Blog' itemscope='itemscope' class="wp-singular computer_media-template-default single single-computer_media postid-56808 wp-custom-logo wp-embed-responsive wp-theme-astra wp-child-theme-astra-child ast-desktop ast-separate-container ast-left-sidebar astra-4.12.6 group-blog ast-blog-single-style-1 ast-custom-post-type ast-single-post ast-inherit-site-logo-transparent ast-hfb-header ast-full-width-primary-header ast-box-layout ast-normal-title-enabled astra-addon-4.12.4"E\EF itemtype='https://schema.org/Blog' itemscope='itemscope' class="wp-singular computer_media-template-default single single-computer_media postid-56808 wp-custom-logo wp-embed-responsive wp-theme-astra wp-child-theme-astra-child ast-desktop ast-separate-container ast-left-sidebar astra-4.12.6 group-blog ast-blog-single-style-1 ast-custom-post-type ast-single-post ast-inherit-site-logo-transparent ast-hfb-header ast-full-width-primary-header ast-box-layout ast-normal-title-enabled astra-addon-4.12.4"

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
\ED\B0\CD\AA\E1\DC\C9\C5

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
A

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
C itemtype='https://schema.org/Blog' itemscope='itemscope' class="wp-singular computer_media-template-default single single-computer_media postid-56808 wp-custom-logo wp-embed-responsive wp-theme-astra wp-child-theme-astra-child ast-desktop ast-separate-container ast-left-sidebar astra-4.12.6 group-blog ast-blog-single-style-1 ast-custom-post-type ast-single-post ast-inherit-site-logo-transparent ast-hfb-header ast-full-width-primary-header ast-box-layout ast-normal-title-enabled astra-addon-4.12.4"\C5

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
\EB\EF\CB\EB

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
\C5 itemtype='https://schema.org/Blog' itemscope='itemscope' class="wp-singular computer_media-template-default single single-computer_media postid-56808 wp-custom-logo wp-embed-responsive wp-theme-astra wp-child-theme-astra-child ast-desktop ast-separate-container ast-left-sidebar astra-4.12.6 group-blog ast-blog-single-style-1 ast-custom-post-type ast-single-post ast-inherit-site-logo-transparent ast-hfb-header ast-full-width-primary-header ast-box-layout ast-normal-title-enabled astra-addon-4.12.4"

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
\EB\C1\EB\CD\D6\C1\D7\C9

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
A

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
CE itemtype='https://schema.org/Blog' itemscope='itemscope' class="wp-singular computer_media-template-default single single-computer_media postid-56808 wp-custom-logo wp-embed-responsive wp-theme-astra wp-child-theme-astra-child ast-desktop ast-separate-container ast-left-sidebar astra-4.12.6 group-blog ast-blog-single-style-1 ast-custom-post-type ast-single-post ast-inherit-site-logo-transparent ast-hfb-header ast-full-width-primary-header ast-box-layout ast-normal-title-enabled astra-addon-4.12.4" itemtype='https://schema.org/Blog' itemscope='itemscope' class="wp-singular computer_media-template-default single single-computer_media postid-56808 wp-custom-logo wp-embed-responsive wp-theme-astra wp-child-theme-astra-child ast-desktop ast-separate-container ast-left-sidebar astra-4.12.6 group-blog ast-blog-single-style-1 ast-custom-post-type ast-single-post ast-inherit-site-logo-transparent ast-hfb-header ast-full-width-primary-header ast-box-layout ast-normal-title-enabled astra-addon-4.12.4"F

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
D\ED\B0

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
B

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
D\FE

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
\EE\C9

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top

Side Scrolling Banner

This file is part of and Timex Sinclair Public Domain Library Tape 1007. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Banner

This program displays a scrolling marquee of a user-entered message across the screen using a machine code routine embedded in a REM statement at line 1. The user’s message is accepted via INPUT, then each character’s code is POKEd into memory starting at address 31744 (0x7C00), with a Form Feed character (code 12) used as a terminator. The machine code is invoked repeatedly via USR 16514 (the start of the REM statement data at line 1), creating a continuous loop. The routine at 0x40AA and related addresses suggests it handles the actual character shifting/display logic in Z80 assembly, including what appears to be a bit-rotation technique (CB 23/CB 12 = SLA E/RL D style shifts) to scroll characters across the display.


Program Analysis

Program Structure

The program is short and purposeful, divided into a setup phase and a run loop:

  1. Line 1 (REM): Contains the Z80 machine code routine used by the marquee scroller.
  2. Lines 10–30: Prompt the user to enter a message string.
  3. Lines 40–70: Transfer the message into a fixed memory buffer at address 31744 (0x7C00), byte by byte, terminated with code 12 (Form Feed).
  4. Lines 80–90: Repeatedly call the machine code routine via USR 16514, forming an infinite display loop.
  5. Lines 100–120: CLEAR, SAVE, and RUN — the program’s save/autostart block.

Machine Code in the REM Statement

Line 1’s REM token is followed by raw Z80 opcodes. The BASIC line structure on this platform places the REM data bytes immediately after the keyword, and USR 16514 jumps to the first byte of the REM content (line 1 starts at address 16509; the data begins at 16514 after the line header and REM token). The routine is 89 bytes long.

Key opcodes decoded from the hex stream:

  • 21 00 7CLD HL, 0x7C00: loads the base address of the message buffer.
  • 5E 23 3E 0C BB 28 1D — loads a byte, increments HL, compares to 0x0C (Form Feed terminator), jumps if equal (end of string).
  • CB 23 CB 12SLA E / RL D: bit-shift operations used to scroll pixel columns of a character.
  • 10 FADJNZ loop for iterating over 8 pixel rows of each character.
  • 21 00 1E 19 11 EF 40 01 08 00 ED B0LD HL, ADD HL,DE, LD DE, 0x40EF, LD BC, 8, LDIR: block copy of 8 bytes (one character column) into the display or scroll buffer.
  • CD AA 40CALL 0x40AA: calls a sub-routine within the REM block itself (at offset 0x40AA − 0x4002 = offset 168 from line start, i.e., the second internal subroutine).
  • C9RET: returns to BASIC after each scroll step.

Message Buffer and Terminator

The message is stored at a fixed high-memory address: 31744 decimal (0x7C00). Each character is POKEd individually using:

POKE (A-1)+I, CODE (A$(I TO I))

After the loop, line 70 writes code 12 (Form Feed, CHR$ 12) as an end-of-string sentinel, which the machine code uses to detect the end of the message and wrap around.

Key BASIC Idioms

  • USR 16514 returns an integer value to BASIC (placed in L at the RET), assigned to L via LET L=USR 16514. The return value is discarded; the call is purely for the side-effect of scrolling one step.
  • The GOTO 80 at line 90 creates a tight infinite loop calling the machine code once per BASIC iteration, with BASIC overhead between each scroll step acting as a natural pace control.
  • A$(I TO I) is the idiomatic single-character slice used to extract individual characters from a string for CODE.

Internal Subroutine Layout

The REM block contains at least two distinct subroutines, called via CALL instructions using absolute addresses within the REM area (around 0x4080–0x40D6 range). This self-referential calling pattern is typical of machine code packed entirely into a REM statement, where the programmer must calculate absolute addresses for each sub-routine entry point.

Notable Techniques

  • Using a REM statement as a machine code store is a well-established technique: the BASIC interpreter skips REM content, so arbitrary bytes can be embedded without affecting parsing.
  • The pixel-level scrolling is achieved by the SLA/RL shift chain operating on character bitmap data, shifting one pixel column at a time — a classic smooth-scroll approach in Z80 assembly.
  • LDIR (block copy) is used for efficient transfer of character column data into the scroll buffer, avoiding slow byte-by-byte loops in machine code.
  • The message buffer at 0x7C00 is well above the typical program/variable area, safely out of reach of BASIC’s memory management during normal operation.

Potential Anomalies

  • If the user enters an empty string, the loop at lines 40–60 does not execute, and line 70 POKEs code 12 to address 31744, which is correct — the machine code will immediately see the terminator. The scroller will display nothing and loop, which is benign.
  • There is no upper bound check on the length of A$; a very long string could overwrite memory beyond 0x7C00, though in practice INPUT length is constrained by available screen/edit buffer space.
  • Line 100 (CLEAR) and line 120 (RUN) are unreachable during normal execution — they exist solely as part of the save block to set up autostart behaviour.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Side Scrolling Banner

Source Code

   1 REM \21\00\7C\5E\23\3E\0C\BB\28\1D\E5\16\00\06\03\CB\23\CB\12\10\FA\21\00\1E\19\11\EF\40\01\08\00\ED\B0\CD\AA\40\E1\18\DC\C9\06\08\C5\2A\0C\40\01\C5\00\09\EB\21\EF\40\06\08\CB\06\EB\38\04\36\00\18\02\36\17\C5\01\21\00\09\EB\23\C1\10\EB\CD\D6\40\C1\10\D7\C9\2A\0C\40\23\3E\16\01\1F\00\54\5D\23\ED\B0\2B\36\00\23\23\3D\FE\00\20\EE\C9\00\00\00\00\00\18\18\00
  10 LET A=31744
  20 PRINT AT 10,18;"ENTER MESSAGE"
  30 INPUT A$
  40 FOR I=1 TO LEN A$
  50 POKE (A-1)+I,CODE (A$(I TO I))
  60 NEXT I
  70 POKE (A-1)+I,12
  80 LET L=USR 16514
  90 GOTO 80
 100 CLEAR 
 110 SAVE "1029%8"
 120 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
10 LET A=31744 20 PRINT AT 10,18;"ENTER MESSAGE" 30 INPUT A$ 40 FOR I=1 TO LEN A$ 50 POKE (A-1)+I,CODE (A$(I TO I)) 60 NEXT I 70 POKE (A-1)+I,12 80 LET L=USR 16514 90 GOTO 80 100 CLEAR 110 SAVE "1029%8" 120 RUN

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top