ncatelli / spasm

An experimental multi-target assembler.
Apache License 2.0
4 stars 0 forks source link

Initial implementation of character constants #123

Closed ncatelli closed 3 years ago

ncatelli commented 3 years ago

Introduction

This PR adds ascii characters as a type that is recognized by the preparser effectively being translated to an underlying byte type.

example:

.define byte test 0xff
.define char testchar 'a'

.origin 0x8000
init:
  nop
  lda #test
  lda #testchar

.origin 0xfffc
  .word init
  .char 'a'
  .char 'b'

yields:

vscode ➜ /workspaces/spasm (feature/122/character-preparser-types ✗) $ hexdump -C a.out                           
00000000  ea a9 ff a9 61 00 00 00  00 00 00 00 00 00 00 00  |....a...........|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00007ff0  00 00 00 00 00 00 00 00  00 00 00 00 00 80 61 62  |..............ab|
00008000

TODO

Linked Issues

resolves #122

Dependencies

Test

Review

Deployment

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.1.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: