DYSTOPIANPIXEL

Testing and downloads

Download the examples and record ordinary and boundary-case results.

Next Asset Lab concept artwork showing sprite patterns, palette colours and animation frames
Next Asset Lab concept artwork · Begin with Odin Dev.2k and the foundations of Z80 assembly.
TUTORIAL 2 / PART 15

A disciplined Odin test session

Complete the following sequence for the final helper, recording what you observe rather than assuming that every run will match the text automatically.

  • From the NextZXOS/NextBASIC prompt, launch .odin and identify the Odin Monitor.
  • Create or load tut02.odn, use EDIT to enter the final source, and return to the Monitor.
  • Enter S; use LS if you want to confirm the native source is on disk.
  • Enter A. Proceed only when Odin reports successful assembly.
  • Enter T. Confirm the labels start and clamp_to_15 resolve to addresses; with our tutorial origin, expect $6000 and $6009 respectively.
  • Enter M $6000. Compare the first fifteen bytes with the printed reference sequence.
  • Enter R. Inspect A and HL, and record whether A is $0F for the $13 input.
  • Change only LD A,$13 to LD A,$07. Save, reassemble, inspect if needed, then run again. Expect A = $07.
  • Restore the $13 version for the final saved lesson, assemble once more, save it, and export text with TS tut02.asm.
  • Use LS to check for tut02.odn and tut02.asm. If desired, re-import the text in a later session using TL tut02.asm.

The file tut02.odn is Odin’s native working source. The file tut02.asm is the portable source listing. Keep both; the text file is especially useful when you later move the code to a version-controlled tree and a repeatable packaging toolchain.

Downloadable Odin examples for each stage

Use the accompanying Next Asset Lab Tutorial 2 Odin Source Pack ZIP. Its .ASM filenames deliberately use the short 8.3 format. If your installation handles case-insensitive filenames, upper- or lower-case spelling of these names is equivalent. Each file is a separate complete experiment, not a piece to append to another listing.

T02F01.ASMFlagsA=$00; F=$51 from $FF + $01.
T02SGN.ASMSigned comparisonA=$80; C clear and P/V set after CP $7F.
T02DEC.ASMConditional branchA=$12, B=$01 when compared with $12.
T02RNG.ASMUnsigned CarryA=$10, B=$01 when compared with $20.
T02LOP.ASMDJNZ loopA=$03, B=$00 after three iterations.
T02CAL.ASMCALL and RETA=$08 after add_three; HL=$6000.
T02STK.ASMPUSH and POPBC restored to $1234.
T02BAD.ASMBroken contractBC unexpectedly becomes $0034.
T02FIX.ASMCorrect contractBC remains $1234.
TUT02.ASMFinal helperA=$0F for input $13; change input to $07 for early return.

For each downloaded file, use Odin Monitor TL filename to import the plain-text listing (for example, TL T02DEC.ASM). Save as a native .ODN document if you want an Odin-native working copy. In the Monitor: S saves, A assembles, T shows symbols, M $6000 inspects bytes, R runs and shows registers. Test one example at a time and save the last good source before editing it.

Do not treat a successful A (assembly) or a printed expected result as evidence of a verified hardware result. Compare the actual Odin output with the lesson and record differences. In particular, note the installed Odin build, any errors and the actual bytes shown at $6000.

Test record

1Input $13$0Fstart and helper labels present
2Input $07$07Early RET C path taken
3Input $00$00Lower boundary
4Input $0F$0FHighest permitted value
5Input $10$0FFirst rejected value
6Input $FF$0FUpper unsigned boundary

You do not have to run all six tests before understanding the lesson, but they are an excellent first example of testing boundary values. A routine may work for an ordinary input and fail at an edge. As the application grows, we will build this habit into its production test plan.

Download the source examples

All ten Odin examples (ZIP) ↓Final helper: TUT02.ASM ↓

Import one example at a time with Odin’s TL command. These are plain-text assembly sources; save a native ODN copy before editing if required.