From a6698e3eadca584a90d9c2a7264e0a6843745925 Mon Sep 17 00:00:00 2001 From: Neil McPhail Date: Sun, 10 Nov 2024 19:17:37 +0000 Subject: [PATCH] Add a custom entry point to the user code The routine does not have to start from the first byte of machine code --- code.asm | 10 ++++++++++ remload.asm | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/code.asm b/code.asm index 0e7aada..d5b9e75 100644 --- a/code.asm +++ b/code.asm @@ -1,2 +1,12 @@ +; This is the main file you will edit to add your machine code to the REM statement. +; You _must_ include the "entry_point" tag to point to the address which will called by the BASIC "PRINT USR" statement. +; The default code below is for illustration only, and can be deleted. +; But REMEMBER TO ADD THE entry_point TAG TO YOUR OWN CODE! + + +data_start: ;if your routine starts here, move the entry_point tag here too ld bc, 42 ret + +entry_point: ;move this tag to the start point of your code + jr data_start diff --git a/remload.asm b/remload.asm index 8dd920a..14eaae6 100644 --- a/remload.asm +++ b/remload.asm @@ -45,7 +45,7 @@ printusr: db "0" ;don't know if actual value is important db #0e db 0,0 - dw code ;actual call to REM statement code + dw entry_point ;actual call to REM statement code db 0 db ':'