mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-03 10:29:41 +00:00
Change Byte -> UByte conversion to use a "Word -> UByte" conversion, rather than introducing a new "Byte -> UByte" conversion.
The latter would require more changes to the code generator to understand it, whereas this approach doesn't require any changes. This is arguably less clean, but it matches other places where a byte value is subsequently operated on as a word without an explicit conversion, and the assembly instruction generated is the same.
This commit is contained in:
parent
a39c06d268
commit
0df71da4f1
3
CGI.pas
3
CGI.pas
@ -857,6 +857,9 @@ if codeGeneration then begin
|
||||
else if (baseTypeEnum(fp1) in [cgUByte])
|
||||
and (baseTypeEnum(fp2) in [cgByte,cgUByte]) then
|
||||
goto 1
|
||||
else if (baseTypeEnum(fp1) = cgByte)
|
||||
and (baseTypeEnum(fp2) = cgUByte) then
|
||||
lcode^.q := (ord(cgWord) << 4) | ord(cgUByte)
|
||||
else
|
||||
lcode^.q := (fp1 << 4) | fp2;
|
||||
|
||||
|
3
Gen.pas
3
Gen.pas
@ -1131,7 +1131,6 @@ const {note: these constants list all legal }
|
||||
cExtended = $09;
|
||||
cVoid = $0B;
|
||||
|
||||
byteToUByte = $01;
|
||||
byteToWord = $02;
|
||||
byteToUword = $03;
|
||||
byteToLong = $04;
|
||||
@ -1250,7 +1249,7 @@ else if op^.q in [ubyteToLong,ubyteToUlong,uwordToLong,uwordToUlong] then
|
||||
GenImplied(m_pha);
|
||||
end; {else}
|
||||
end {else if}
|
||||
else if op^.q in [byteToUByte,wordToByte,wordToUbyte,uwordToByte,uwordToUbyte] then
|
||||
else if op^.q in [wordToByte,wordToUbyte,uwordToByte,uwordToUbyte] then
|
||||
GenNative(m_and_imm, immediate, $00FF, nil, 0)
|
||||
else if op^.q in [byteToReal,uByteToReal,wordToReal] then
|
||||
GenCall(11)
|
||||
|
Loading…
Reference in New Issue
Block a user