diff a09.c @ 29:3c14d647bb51

assembler and emulator fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 11 Jul 2018 21:16:06 +0900
parents 51a35f0347f6
children 7c5379eb406e
line wrap: on
line diff
--- a/a09.c	Wed Jul 11 09:03:54 2018 +0900
+++ b/a09.c	Wed Jul 11 21:16:06 2018 +0900
@@ -43,6 +43,9 @@
                 Compatibility: Octal number prefix "&".
         2014-07-15 j at klasek at
                 Fixed usage message.
+        2018-07-11
+                leax  $ED00/256,x kernel offset in map
+                should be positive offset expr should be int(32bit)
 */
 
 #include <stdlib.h>
@@ -354,12 +357,12 @@
  srcptr--;
 }
 
-short scanexpr(int);
+int scanexpr(int);
 
-short scandecimal()
+int scandecimal()
 {
  char c;
- short t=0;
+ int t=0;
  c=*srcptr++;
  while(isdigit(c)) {
   t=t*10+c-'0';
@@ -369,9 +372,9 @@
  return t;
 }
 
-short scanhex()
+int scanhex()
 {
- short t=0,i=0;
+ int t=0,i=0;
  srcptr++;
  scanname();
  while(namebuf[i]>='0'&&namebuf[i]<='F') {
@@ -383,9 +386,9 @@
  return t;
 }
 
-short scanchar()
+int scanchar()
 {
- short t;
+ int t;
  srcptr++;
  t=*srcptr;
  if(t)srcptr++;
@@ -393,10 +396,10 @@
  return t;
 }
 
-short scanbin()
+int scanbin()
 {
  char c;
- short t=0;
+ int t=0;
  srcptr++;
  c=*srcptr++;
  while(c=='0'||c=='1') {
@@ -407,10 +410,10 @@
  return t;
 }
 
-short scanoct()
+int scanoct()
 {
  char c;
- short t=0;
+ int t=0;
  srcptr++;
  c=*srcptr++;
  while(c>='0'&&c<='7') {
@@ -422,7 +425,7 @@
 }
 
 
-short scanlabel()
+int scanlabel()
 {
  struct symrecord * p;
  scanname();
@@ -443,10 +446,10 @@
 }
 
 
-short scanfactor()
+int scanfactor()
 {
  char c;
- short t;
+ int t;
  skipspace();
  c=*srcptr;
  if(isalpha(c))return scanlabel();
@@ -484,9 +487,9 @@
    two addresses in same module */
 
 
-short scanexpr(int level) /* This is what you call _recursive_ descent!!!*/
+int scanexpr(int level) /* This is what you call _recursive_ descent!!!*/
 {
- short t,u;
+ int t,u;
  char oldcat,c;
  exprcat=0;
  if(level==10)return scanfactor();