Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
a05beb9ceThis file is pinned to the selected release. Download the original to open it in your design tool.
;;
;; sysdef.asm: This file contains definitions to simplify assembler programming
;; and for accessing the various hardware registers via MMIO
;;
;
;***************************************************************************************
;* Assembler macros which make life much easier:
;***************************************************************************************
;
;
; Some register short names:
;
;
;***************************************************************************************
;* IO-page addresses: Default: 8 registers per block
;***************************************************************************************
;
.equ IO$AREA_START , 0xFF00
;
;---------------------------------------------------------------------------------------
; Block FF00: FUNDAMENTAL IO
;---------------------------------------------------------------------------------------
;
; Switch-register:
;
.equ IO$SWITCH_REG , 0xFF00 ; 16 binary keys
;
; Registers for TIL-display:
;
.equ IO$TIL_DISPLAY , 0xFF01 ; Address of TIL-display
.equ IO$TIL_MASK , 0xFF02 ; Mask register of TIL display
;
; USB-keyboard-registers:
;
.equ IO$KBD_STATE , 0xFF04 ; Status register of USB keyboard
; Bit 0 (read only): New ASCII character avaiable for reading
; (bits 7 downto 0 of Read register)
; Bit 1 (read only): New special key available for reading
; (bits 15 downto 8 of Read register)
; Bits 2..4 (read/write): Locales: 000 = US English keyboard layout,
; 001 = German layout, others: reserved for more locales
; Bits 5..7 (read only): Modifiers: 5 = shift, 6 = alt, 7 = ctrl
; Only valid, when bits 0 and/or 1 are '1'
;
.equ IO$KBD_DATA , 0xFF05 ; Data register of USB keyboard
; Contains the ASCII character in bits 7 downto 0 or the special key code
; in 15 downto 8. The "or" is meant exclusive, i.e. it cannot happen that
; one transmission contains an ASCII character PLUS a special character.
;
;---------------------------------------------------------------------------------------
; Block FF08: SYSTEM COUNTERS
;---------------------------------------------------------------------------------------
;
; CYCLE-COUNT-registers
;
.equ IO$CYC_LO , 0xFF08 ; low word of 48-bit counter
.equ IO$CYC_MID , 0xFF09 ; middle word of 48-bit counter
.equ IO$CYC_HI , 0xFF0A ; high word of 48-bit counter
.equ IO$CYC_STATE , 0xFF0B ; status register
; Bit 0 (write only): Reset counter to zero and start counting, i.e.
; bit 1 is automatically set to 1 when resetting
; Bit 1 (read/write): Start/stop counter
;
; INSTRUCTION-COUNT-registers
;
.equ IO$INS_LO , 0xFF0C ; low word of 48-bit counter
.equ IO$INS_MID , 0xFF0D ; middle word of 48-bit counter
.equ IO$INS_HI , 0xFF0E ; high word of 48-bit counter
.equ IO$INS_STATE , 0xFF0F ; status register
; Bit 0 (write only): Reset counter to zero and start counting, i.e.
; bit 1 is automatically set to 1 when resetting
; Bit 1 (read/write): Start/stop counter
;
;---------------------------------------------------------------------------------------
; Block FF10: UART
;---------------------------------------------------------------------------------------
;
; QNICE-FPGA supports: IO$UART_SRA, IO$UART_RHRA and IO$UART_THRA
; The other registers are mentioned for completeness to map real hardware (16550)
;
.equ IO$UART_BASE_ADDRESS , 0xFF10
.equ IO$UART_MR1A , 0xFF10 ; n/a
.equ IO$UART_MR1B , 0xFF10 ; n/a
.equ IO$UART_SRA , 0xFF11 ; Status register (relative to base address)
.equ IO$UART_RHRA , 0xFF12 ; Receiving register (relative to base address)
.equ IO$UART_THRA , 0xFF13 ; Transmitting register (relative to base address)
;
;---------------------------------------------------------------------------------------
; Block FF18: EAE
;---------------------------------------------------------------------------------------
;
; EAE (Extended Arithmetic Element) registers:
;
.equ IO$EAE_OPERAND_0 , 0xFF18
.equ IO$EAE_OPERAND_1 , 0xFF19
.equ IO$EAE_RESULT_LO , 0xFF1A
.equ IO$EAE_RESULT_HI , 0xFF1B
.equ IO$EAE_CSR , 0xFF1C ; Command and Status Register
;
; EAE-Opcodes (CSR): 0x0000 MULU 32-bit result in LO HI
; 0x0001 MULS 32-bit result in LO HI
; 0x0002 DIVU result in LO, modulo in HI
; 0x0003 DIVS result in LO, modulo in HI
; Bit 15 of CSR is the busy bit. If it is set, the EAE is still busy crunching numbers.
;
;---------------------------------------------------------------------------------------
; Block FF20: SD CARD
;---------------------------------------------------------------------------------------
;
; SD CARD INTERFACE registers
;
.equ IO$SD_BASE_ADDRESS , 0xFF20
.equ IO$SD_ADDR_LO , 0xFF20 ; low word of 32bit linear SD card block address
.equ IO$SD_ADDR_HI , 0xFF21 ; high word of 32bit linear SD card block address
.equ IO$SD_DATA_POS , 0xFF22 ; "Cursor" to navigate the 512-byte data buffer
.equ IO$SD_DATA , 0xFF23 ; read/write 1 byte from/to the 512-byte data buffer
.equ IO$SD_ERROR , 0xFF24 ; error code of last operation (read only)
.equ IO$SD_CSR , 0xFF25 ; Command and Status Register (write to execute command)
;
; SD-Opcodes (CSR): 0x0000 Reset SD card
; 0x0001 Read 512 bytes from the linear block address
; 0x0002 Write 512 bytes to the linear block address
; Bits 0 .. 2 are write-only (reading always returns 0)
; Bits 13 .. 12 return the card type: 00 = no card / unknown card
; 01 = SD V1
; 10 = SD V2
; 11 = SDHC
; Bit 14 of the CSR is the error bit: 1, if the last operation failed. In such
; a case, the error code is in IO$SD_ERROR and
; you need to reset the controller to go on
; Bit 15 of the CSR is the busy bit: 1, if current operation is still running
;
;---------------------------------------------------------------------------------------
; Block FF28: TIMER 0 and 1
;---------------------------------------------------------------------------------------
;
; Interrupt timer: There are two timers capable of generating interrupts.
; Each timer is controlled by three 16 bit registers:
;
; IO$TIMER_x_PRE: The 100 kHz timer clock is divided by the value stored in
; this device register. 100 (which corresponds to 0x0064 in
; the prescaler register) yields a 1 millisecond pulse which
; in turn is fed to the actual counter.
; IO$TIMER_x_CNT: When the number of output pulses from the prescaler circuit
; equals the number stored in this register, an interrupt will
; be generated (if the interrupt address is 0x0000, the
; interrupt will be suppressed).
; IO$TIMER_x_INT: This register contains the address of the desired interrupt
; service routine.
;
.equ IO$TIMER_BASE_ADDRESS , 0xFF28
.equ IO$TIMER_0_PRE , 0xFF28
.equ IO$TIMER_0_CNT , 0xFF29
.equ IO$TIMER_0_INT , 0xFF2A
.equ IO$TIMER_1_PRE , 0xFF2B
.equ IO$TIMER_1_CNT , 0xFF2C
.equ IO$TIMER_1_INT , 0xFF2D
;
;---------------------------------------------------------------------------------------
; Block FF30: VGA (double block, 16 registers)
;---------------------------------------------------------------------------------------
;
.equ VGA$STATE , 0xFF30 ; VGA status register
; Bits 11-10: Hardware scrolling / offset enable: Bit #10 enables the use
; of the offset register #4 (display offset) and bit #11
; enables the use of register #5 (read/write offset).
; Bit 9: Busy: VGA is currently busy, e.g. clearing the screen,
; printing, etc. While busy, commands will be ignored, but
; they can still be written into the registers, though
; Bit 8: Set bit to clear screen. Read bit to find out, if clear
; screen is still active
; Bit 7: VGA enable (1 = on; 0: no VGA signal is generated)
; Bit 6: Hardware cursor enable
; Bit 5: Hardware cursor blink enable
; Bit 4: Hardware cursor mode: 1 - small
; 0 - large
; Bits 2-0: Output color for the whole screen, bits (2, 1, 0) = RGB
.equ VGA$CR_X , 0xFF31 ; VGA cursor X position
.equ VGA$CR_Y , 0xFF32 ; VGA cursor Y position
.equ VGA$CHAR , 0xFF33 ; write: VGA character to be displayed
; read: character "under" the cursor
.equ VGA$OFFS_DISPLAY , 0xFF34 ; Offset in bytes that is used when displaying
; the video RAM. Scrolling forward one line
; means adding 0x50 to this register.
; Only works, if bit #10 in VGA$STATE is set.
.equ VGA$OFFS_RW , 0xFF35 ; Offset in bytes that is used, when you read
; or write to the video RAM using VGA$CHAR.
; Works independently from VGA$OFFS_DISPLAY.
; Active, when bit #11 in VGA$STATE is set.
.equ VGA$HDMI_H_MIN , 0xFF36 ; HDMI Data Enable: X: minimum valid column
.equ VGA$HDMI_H_MAX , 0xFF37 ; HDMI Data Enable: X: maximum valid column
.equ VGA$HDMI_V_MAX , 0xFF38 ; HDMI Data Enable: Y: maximum row (line)
;
;---------------------------------------------------------------------------------------
; Block FFF0: MEGA65 (double block, 16 registers)
;---------------------------------------------------------------------------------------
;
; HyperRAM
;
.equ IO$M65HRAM_LO , 0xFFF0 ; Low word of address (15 downto 0)
.equ IO$M65HRAM_HI , 0xFFF1 ; High word of address (26 downto 16)
.equ IO$M65HRAM_DATA8 , 0xFFF2 ; HyperRAM native 8-bit data in/out
.equ IO$M65HRAM_DATA16 , 0xFFF3 ; HyperRAM 16-bit data in/out
;
;***************************************************************************************
;* Constant definitions
;***************************************************************************************
;
; ========== VGA ==========
.equ VGA$MAX_X , 79 ; Max. X-coordinate in decimal!
.equ VGA$MAX_Y , 39 ; Max. Y-coordinate in decimal!
.equ VGA$MAX_CHARS , 3200 ; 80 * 40 chars
.equ VGA$CHARS_PER_LINE , 80
.equ VGA$EN_HW_CURSOR , 0x0040 ; Show hardware cursor
.equ VGA$EN_HW_SCRL , 0x0C00 ; Hardware scrolling enable
.equ VGA$CLR_SCRN , 0x0100 ; Clear screen
.equ VGA$BUSY , 0x0200 ; VGA is currently performing a task
.equ VGA$COLOR_RED , 0x0004
.equ VGA$COLOR_GREEN , 0x0002
.equ VGA$COLOR_BLUE , 0x0001
.equ VGA$COLOR_WHITE , 0x0007
; ========== CYCLE COUNTER ==========
.equ CYC$RESET , 0x0001 ; Reset cycle counter
.equ CYC$RUN , 0x0002 ; Start/stop counter
; ========== CYCLE COUNTER ==========
.equ INS$RESET , 0x0001 ; Reset instruction counter
.equ INS$RUN , 0x0002 ; Start/stop counter
; ========== EAE ==========
.equ EAE$MULU , 0x0000 ; Unsigned 16 bit multiplication
.equ EAE$MULS , 0x0001 ; Signed 16 bit multiplication
.equ EAE$DIVU , 0x0002 ; Unsigned 16 bit division with remainder
.equ EAE$DIVS , 0x0003 ; Signed 16 bit division with remainder
.equ EAE$BUSY , 0x8000 ; Busy flag (1 = operation still running)
; ========== SD CARD ==========
.equ SD$CMD_RESET , 0x0000 ; Reset SD card
.equ SD$CMD_READ , 0x0001 ; Read 512 bytes from SD to internal buffer
.equ SD$CMD_WRITE , 0x0002 ; Write 512 bytes from int. buf. to SD
.equ SD$BIT_ERROR , 0x4000 ; Error flag: 1, if last operation failed
.equ SD$BIT_BUSY , 0x8000 ; Busy flag: 1, if current op. is still running
.equ SD$TIMEOUT_MID , 0x0479 ; equals ~75.000.000 cycles, i.e. 1.5sec @ 50 MHz
.equ SD$ERR_MASK , 0x00FF ; AND mask for errors: HI byte = state machine info, so mask it for error checks
.equ SD$ERR_R1_ERROR , 0x0001 ; SD Card R1 error (R1 bit 6-0)
.equ SD$ERR_CRC_OR_TIMEOUT , 0x0002 ; Read CRC error or Write Timeout error
.equ SD$ERR_RESPONSE_TOKEN , 0x0003 ; Data Response Token error (Token bit 3)
.equ SD$ERR_ERROR_TOKEN , 0x0004 ; Data Error Token error (Token bit 3-0)
.equ SD$ERR_WRITE_PROTECT , 0x0005 ; SD Card Write Protect switch
.equ SD$ERR_CARD_UNUSABLE , 0x0006 ; Unusable SD card
.equ SD$ERR_NO_CARD , 0x0007 ; No SD card (no response from CMD0)
.equ SD$ERR_READ_TIMEOUT , 0x0008 ; Timeout while trying to receive the read start token "FE"
.equ SD$ERR_TIMEOUT , 0xEEFF ; General timeout
.equ SD$CT_SD_V1 , 0x0001 ; Card type: SD Version 1
.equ SD$CT_SD_V2 , 0x0002 ; Card type: SD Version 2
.equ SD$CT_SDHC , 0x0003 ; Card type: SDHC (or SDXC)
; ========== FAT32 =============
; FAT32 ERROR CODES
.equ FAT32$ERR_MBR , 0xEE10 ; no or illegal Master Boot Record (MBR) found
.equ FAT32$ERR_PARTITION_NO , 0xEE11 ; the partition number needs to be in the range 1 .. 4
.equ FAT32$ERR_PARTTBL , 0xEE12 ; no or illegal partition table entry found (e.g. no FAT32 partition)
.equ FAT32$ERR_NOTIMPL , 0xEE13 ; functionality is not implemented
.equ FAT32$ERR_SIZE , 0xEE14 ; partition size or volume size too large (see doc/constraints.txt)
.equ FAT32$ERR_NOFAT32 , 0xEE15 ; illegal volume id (either not 512 bytes per sector, or not 2 FATs or wrong magic)
.equ FAT32$ERR_ILLEGAL_SIC , 0xEE16 ; trying to read/write a sector within a cluster that is out of range
.equ FAT32$ERR_ILLEGAL_CLUS , 0xEE17 ; trying to access an illegal cluster number
.equ FAT32$ERR_CORRUPT_DH , 0xEE18 ; corrupt directory handle (e.g. because current to-be-read offs > sector size)
.equ FAT32$ERR_DIRNOTFOUND , 0xEE19 ; directory not found (illegal path name passed to change directory command)
.equ FAT32$ERR_FILENOTFOUND , 0xEE20 ; file not found
.equ FAT23$ERR_SEEKTOOLARGE , 0xEE21 ; seek position > file size
; FAT32 STATUS CODES
.equ FAT32$EOF , 0xEEEE ; end of file reached
; LAYOUT OF THE MOUNT DATA STRUCTURE (DEVICE HANDLE)
.equ FAT32$DEV_RESET , 0x0000 ; pointer to device reset function
.equ FAT32$DEV_BLOCK_READ , 0x0001 ; pointer to 512-byte block read function
.equ FAT32$DEV_BLOCK_WRITE , 0x0002 ; pointer to 512-byte block write function
.equ FAT32$DEV_BYTE_READ , 0x0003 ; pointer to 1-byte read function (within block buffer)
.equ FAT32$DEV_BYTE_WRITE , 0x0004 ; pointer to 1-byte write function (within block buffer)
.equ FAT32$DEV_PARTITION , 0x0005 ; number of partition to be mounted
.equ FAT32$DEV_FS_LO , 0x0006 ; file system start address (LBA): low word
.equ FAT32$DEV_FS_HI , 0x0007 ; file system start address (LBA): high word
.equ FAT32$DEV_FAT_LO , 0x0008 ; fat start address (LBA): low word
.equ FAT32$DEV_FAT_HI , 0x0009 ; fat start address (LBA): high word
.equ FAT32$DEV_CLUSTER_LO , 0x000A ; cluster start address (LBA): low word
.equ FAT32$DEV_CLUSTER_HI , 0x000B ; cluster start address (LBA): high word
.equ FAT32$DEV_SECT_PER_CLUS, 0x000C ; sectors per cluster
.equ FAT32$DEV_RD_1STCLUS_LO, 0x000D ; root directory first cluster: low word
.equ FAT32$DEV_RD_1STCLUS_HI, 0x000E ; root directory first cluster: high word
.equ FAT32$DEV_AD_1STCLUS_LO, 0x000F ; currently active directory first cluster: low word
.equ FAT32$DEV_AD_1STCLUS_HI, 0x0010 ; currently active directory first cluster: high word
.equ FAT32$DEV_BUFFERED_FDH , 0x0011 ; FDH which is responsible for the current 512 byte hardware buffer filling
.equ FAT32$DEV_STRUCT_SIZE , 0x0012 ; size (words) of the mount data structure (device handle)
; LAYOUT OF THE FILE HANDLE AND DIRECTORY HANDLE (FDH)
.equ FAT32$FDH_DEVICE , 0x0000 ; pointer to the device handle
.equ FAT32$FDH_CLUSTER_LO , 0x0001 ; current cluster (low word)
.equ FAT32$FDH_CLUSTER_HI , 0x0002 ; current cluster (high word)
.equ FAT32$FDH_SECTOR , 0x0003 ; current sector
.equ FAT32$FDH_INDEX , 0x0004 ; current byte index within current sector
.equ FAT32$FDH_SIZE_LO , 0x0005 ; only in case FDH is a file: low word of file size, otherwise undefined
.equ FAT32$FDH_SIZE_HI , 0x0006 ; only in case FDH is a file: high word of file size, otherwise undefined
.equ FAT32$FDH_READ_LO , 0x0007 ; only in case FDH is a file: low word of already read amount of bytes
.equ FAT32$FDH_READ_HI , 0x0008 ; only in case FDH is a file: high word of already read amount of bytes
.equ FAT32$FDH_STRUCT_SIZE , 0x0009 ; size of the directory handle structure
; FILE ATTRIBUTES
.equ FAT32$FA_READ_ONLY , 0x0001 ; read only file
.equ FAT32$FA_HIDDEN , 0x0002 ; hidden file
.equ FAT32$FA_SYSTEM , 0x0004 ; system file
.equ FAT32$FA_VOLUME_ID , 0x0008 ; volume id (name of the volume)
.equ FAT32$FA_DIR , 0x0010 ; directory
.equ FAT32$FA_ARCHIVE , 0x0020 ; archive flag
.equ FAT32$FA_DEFAULT , 0x0035 ; browse for non hidden files and directories but not for the volume id
.equ FAT32$FA_ALL , 0x0037 ; browse for all files, but not for the volume id
; LAYOUT OF THE DIRECTORY ENTRY STRUCTURE
.equ FAT32$DE_NAME , 0x0000 ; volume, file or directory name, zero terminated (max 256 characters)
.equ FAT32$DE_ATTRIB , 0x0101 ; file attributes (read-only, hidden, system, volume id, directory, archive)
.equ FAT32$DE_SIZE_LO , 0x0102 ; file size: low word
.equ FAT32$DE_SIZE_HI , 0x0103 ; file size: high word
.equ FAT32$DE_YEAR , 0x0104 ; last file write: year (valid range 1980 .. 2107)
.equ FAT32$DE_MONTH , 0x0105 ; last file write: month
.equ FAT32$DE_DAY , 0x0106 ; last file write: day
.equ FAT32$DE_HOUR , 0x0107 ; last file write: hour
.equ FAT32$DE_MINUTE , 0x0108 ; last file write: minute
.equ FAT32$DE_SECOND , 0x0109 ; last file write: second (in 2 second steps, valid range 0 .. 58)
.equ FAT32$DE_CLUS_LO , 0x010A ; start cluster: low word
.equ FAT32$DE_CLUS_HI , 0x010B ; start cluster: high word
.equ FAT32$DE_STRUCT_SIZE , 0x010C ; size (words) of the directory entry data structure of the
; DISPLAY FLAGS FOR FILE ENTRY PRETTY PRINTER
.equ FAT32$PRINT_SHOW_DIR , 0x0001 ; show "<DIR>" indicator
.equ FAT32$PRINT_SHOW_ATTRIB, 0x0002 ; show attributes as "HRSA"
.equ FAT32$PRINT_SHOW_SIZE , 0x0004 ; show file size
.equ FAT32$PRINT_SHOW_DATE , 0x0008 ; show file date as YYYY-MM-DD
.equ FAT32$PRINT_SHOW_TIME , 0x0010 ; show file time as HH:MM
.equ FAT32$PRINT_DEFAULT , 0x001D ; print <DIR> indicator, size, date and time (no attributes)
.equ FAT32$PRINT_ALL , 0x001F ; print all details
; ========== KEYBOARD ==========
; STATUS REGISTER
.equ KBD$NEW_ASCII , 0x0001 ; new ascii character available
.equ KBD$NEW_SPECIAL , 0x0002 ; new special key available
.equ KBD$NEW_ANY , 0x0003 ; any new key available
.equ KBD$ASCII , 0x00FF ; mask the special keys
.equ KBD$SPECIAL , 0xFF00 ; mask the ascii keys
.equ KBD$LOCALE , 0x001C ; bit mask for checking locales
.equ KBD$LOCALE_US , 0x0000 ; default: US keyboard layout
.equ KBD$LOCALE_DE , 0x0004 ; DE: German keyboard layout
.equ KBD$MODIFIERS , 0x00E0 ; bit mask for checking modifiers
.equ KBD$SHIFT , 0x0020 ; modifier "SHIFT" pressed
.equ KBD$ALT , 0x0040 ; modifier "ALT" pressed
.equ KBD$CTRL , 0x0080 ; modifier "CTRL" pressed
; READ REGISTER: COMMON ASCII CODES
.equ KBD$SPACE , 0x0020
.equ KBD$ENTER , 0x000D
.equ KBD$ESC , 0x001B
.equ KBD$TAB , 0x0009
.equ KBD$BACKSPACE , 0x0008
; READ REGISTER: SPECIAL KEYS
.equ KBD$F1 , 0x0100
.equ KBD$F2 , 0x0200
.equ KBD$F3 , 0x0300
.equ KBD$F4 , 0x0400
.equ KBD$F5 , 0x0500
.equ KBD$F6 , 0x0600
.equ KBD$F7 , 0x0700
.equ KBD$F8 , 0x0800
.equ KBD$F9 , 0x0900
.equ KBD$F10 , 0x0A00
.equ KBD$F11 , 0x0B00
.equ KBD$F12 , 0x0C00
.equ KBD$CUR_UP , 0x1000
.equ KBD$CUR_DOWN , 0x1100
.equ KBD$CUR_LEFT , 0x1200
.equ KBD$CUR_RIGHT , 0x1300
.equ KBD$PG_UP , 0x1400
.equ KBD$PG_DOWN , 0x1500
.equ KBD$HOME , 0x1600
.equ KBD$END , 0x1700
.equ KBD$INS , 0x1800
.equ KBD$DEL , 0x1900
; READ REGISTER: CTRL + character is also mapped to an ASCII code
.equ KBD$CTRL_A , 0x0001
.equ KBD$CTRL_B , 0x0002
.equ KBD$CTRL_C , 0x0003
.equ KBD$CTRL_D , 0x0004
.equ KBD$CTRL_E , 0x0005
.equ KBD$CTRL_F , 0x0006
.equ KBD$CTRL_G , 0x0007
.equ KBD$CTRL_H , 0x0008
.equ KBD$CTRL_I , 0x0009
.equ KBD$CTRL_J , 0x000A
.equ KBD$CTRL_K , 0x000B
.equ KBD$CTRL_L , 0x000C
.equ KBD$CTRL_M , 0x000D
.equ KBD$CTRL_N , 0x000E
.equ KBD$CTRL_O , 0x000F
.equ KBD$CTRL_P , 0x0010
.equ KBD$CTRL_Q , 0x0011
.equ KBD$CTRL_R , 0x0012
.equ KBD$CTRL_S , 0x0013
.equ KBD$CTRL_T , 0x0014
.equ KBD$CTRL_U , 0x0015
.equ KBD$CTRL_V , 0x0016
.equ KBD$CTRL_W , 0x0017
.equ KBD$CTRL_X , 0x0018
.equ KBD$CTRL_Y , 0x0019
.equ KBD$CTRL_Z , 0x001A
;
; Useful ASCII constants:
;
.equ CHR$BELL , 0x0007 ; ASCII-BELL character
.equ CHR$TAB , 0x0009 ; ASCII-TAB character
.equ CHR$SPACE , 0x0020 ; ASCII-Space
.equ CHR$CR , 0x000d ; Carriage return
.equ CHR$LF , 0x000a ; Line feed