GitLab has been upgraded to 13.3.6. If you encounter any issues mail code@riscosopen.org

Commit 26325284 authored by Jeffrey Lee's avatar Jeffrey Lee

Add SETBCD macro

Detail:
  hdr/Macros - Add new SETBCD macro, to convert a number to BCD and assign it to a variable
Admin:
  Tested in OMAP3 ROM build


Version 2.04. Tagged as 'HdrSrc-2_04'
parent a9f38dbc
/* (2.03)
/* (2.04)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 2.03
#define Module_MajorVersion_CMHG 2.04
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 19 Mar 2012
#define Module_Date_CMHG 20 Mar 2012
#define Module_MajorVersion "2.03"
#define Module_Version 203
#define Module_MajorVersion "2.04"
#define Module_Version 204
#define Module_MinorVersion ""
#define Module_Date "19 Mar 2012"
#define Module_Date "20 Mar 2012"
#define Module_ApplicationDate "19-Mar-12"
#define Module_ApplicationDate "20-Mar-12"
#define Module_ComponentName "HdrSrc"
#define Module_ComponentPath "castle/RiscOS/Sources/Programmer/HdrSrc"
#define Module_FullVersion "2.03"
#define Module_HelpVersion "2.03 (19 Mar 2012)"
#define Module_LibraryVersionInfo "2:3"
#define Module_FullVersion "2.04"
#define Module_HelpVersion "2.04 (20 Mar 2012)"
#define Module_LibraryVersionInfo "2:4"
......@@ -142,6 +142,7 @@ OldOpt SETA {OPT}
;$label Push $reglist, $cond, $hat Push registers onto the stack
;$label ROR $reg, $val, $cc Generate an ROR instruction
;$label RRX $reg, $cc Generate an RRX instruction
;$var SETBCD $val Convert $var to BCD and assign to variable
;$label ST $reg,$var,$cc Store word or byte
;$label STASH $reglist, $cond, $hat Push registers onto the stack
;$label STRIM $string Output an immediate string
......@@ -1365,6 +1366,25 @@ $label myRRX $reg, $cc
$label MOV$cc $reg, $reg, RRX
MEND
; *****************************************************************************
; *** SETBCD - Convert a number to BCD and store it in a numeric variable ***
; *****************************************************************************
MACRO
$var SETBCD $val
LCLA in
LCLA out
LCLA pos
in SETA $val
out SETA 0
pos SETA 0
WHILE in>0
out SETA out + ((in :MOD: 10) :SHL: pos)
pos SETA pos + 4
in SETA in/10
WEND
$var SETA out
MEND
; ************************************************
; *** ST - Store a byte or a word by knowing ***
; *** how big the store definition was ***
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment