Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembler: @ command errors #4

Open
markarmb opened this issue Sep 12, 2014 · 0 comments
Open

Assembler: @ command errors #4

markarmb opened this issue Sep 12, 2014 · 0 comments

Comments

@markarmb
Copy link

Bug encountered by many students who use @-1 in thier Fill.asm programs.

Numbers outside the range [0, 32767] cause undetected errors in assembly.
This affects all instances of the assembler as used in Assembler, CPUEmulator and HardwareSimulator.

////////////////////////////////////////////////////////////////////////
// FILE:  bad_a.asm
//
// No error messages are generated by this file.

// source      binary
@0          // 0000000000000000     OK
@-1         // 1111111111111111     illegal c-instuction generated
@-2         // 1111111111111110     illegal c-instuction generated
@32767      // 0111111111111111     OK
@32768      // 0000000000010000     RAM address for variable "32768"
@32769      // 0000000000010001     RAM address for variable "32769"
@foo        // 0000000000010010     RAM address for variable "foo"
@32770      // 0000000000001011     ROM address for label "32770"
@-32768     // 1000000000000000     illegal c-instuction generated
@-32769     // 0000000000010011     RAM address for variable "-32769"
@-32770     // 0000000000001100     ROM address for label "-32770"
(32770)     //                      label "32770" (ROM addr = 11)
@0          // 0000000000000000     OK
(-32770)    //                      label "-32770" (ROM addr = 12)

// There are at least two bugs here:
//   o  numbers outside the range [-32678, 32767] are being treated
//      as symbols in all contexts.  (Parser bug?)
//   o  negative numbers are not disallowed in '@' commands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant