A86: Conversion Menu


[Prev][Next][Index][Thread]

A86: Conversion Menu



All right.  I fixed the source.  The label I used called "_data_tbl
didn't exist.  I have no idea why TASM even let it compile.
#include "asm86.h"
#include "Ti86abs.inc"
#include "Ti86asm.inc"

_user_menu		equ		$c274

.org _asm_exec_ram

 ld hl,data_table		;move our data table to "user"
 ld de,_user_menu		;	menu space
 call _mov10B


;a more efficient beginning
 ld hl,$5a92
 rst 20h
 rst 10h
 jr c,Install
 call _delvar
Install:
 ld hl,$5a92
 rst 20h
 ld hl, code_end - code
 call _CREATEPROG
 ld a,b
 ex de,hl
 call $4c3f
 call _SET_ABS_DEST_ADDR
 xor a
 ld hl,code_end - code
 call _SET_MM_NUM_BYTES
 xor a
 ld hl,code
 call _SET_ABS_SRC_ADDR
 call _mm_ldir
 set 6,(iy+$24)
 ret

code:
.db $8e,$28
 call $479f			;pop op1
 ld hl,$56d8
 ld de,($c210)
 call $403c		;check for conversion menu
 jr nz,end
 ld hl,conv_menu	;make it point to our conv menu
 ld ($c210),hl
end:
 ld a,($d625)		;get saved a register
 cp a				;set z flag
 ret

conv_menu:			;patched conversion menu datatable
.db 9,12			;	:added 1 entry
.dw $679c, $67a4
.dw $67ab, $67b1
.dw $d7b8, $67bf
.dw $67c6, $67ce
.dw $67d6, $67de
.dw $67e6, entry

entry:
.db 5
.dw data_table
.db ";-)",0
code_end:

data_table:
.db 8,1
.dw data_table + 4
another_entry:
.db 0
.db "Hey!",0


.end
.end