emu48-mirror/Emu48asc/EMU49ASC.S
2024-03-19 22:37:54 +01:00

50 lines
1.6 KiB
ArmAsm

TITLE Emu49Asc ACSII<->Bin Converter
* Author: Christoph Giesselink
ASSEMBLE
NIBASC /HPHP49-B/
* Please don't blame me if this program destroy your memory content. The
* unsupported entry points are picked up from the beta ROM v1.19-6.
* These entry points may change in future and very important, they have
* changed in past! Use it on your own risk. Adjust the lines below to
* your used ROM version.
*=SetModes EQU #4649A (ROM 1.18, 1.19-4/5)
=SetModes EQU #4A3D4 (ROM 1.19-6)
*=RadixAngle$ EQU #463CF (ROM 1.18, 1.19-4/5)
=RadixAngle$ EQU #4A309 (ROM 1.19-6)
RPL
::
CK1NoBlame
CK&DISPATCH1
THREE ( String )
::
DUP ELEVEN 1_#1-SUB$ ( get first ten characters )
$ "%%HP:" ONE POS$ ( and look for the HP string)
DUP #0=?SKIP ( if found )
::
#5+ LAST$ ( remove it from original )
DUP ";" ONE POS$ ( search for end of modes )
2DUP #1+ LAST$ ( get the rest after modes )
UNROT 1_#1-SUB$ ( get the modes string )
SetModes ( set the current mode )
;
DROP ( drop position or flag )
KINVISLF DROP ( translate string )
palparse ( decode string )
NOTcase2DROP ( on fail -> DROP2 and exit )
DUP CARCOMP ' xSILENT' EQ ( heading xSILENT' object ? )
NOT?SEMI TWO NTHCOMPDROP ( yes, remove it )
;
ZERO ( Any Object )
::
EDITDECOMP$ ( make string )
KVISLF ( translate string )
$ "%%HP:" RadixAngle$ !append$ ( build file header with modes )
$ ";\0D\0A" !append$SWAP ( and CR+LF )
!append$ ( append program )
;
;