Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
psf
psf
@psf@oldbytes.space  ·  activity timestamp 7 days ago

#DesmetC (signed char -> long) promotion is now working on my branch: got it on the first try, which hopefully means I'm internalizing the codebase. Now I will start on tests for mixed-sign arithmetic.

#retrocomputing

  • Copy link
  • Flag this post
  • Block
psf
psf
@psf@oldbytes.space replied  ·  activity timestamp 7 days ago

#DesmetC (signed char -> long) promotion is now working on my branch: got it on the first try, which hopefully means I'm internalizing the codebase. Now I will start on tests for mixed-sign arithmetic.

#retrocomputing

  • Copy link
  • Flag this comment
  • Block
psf
psf
@psf@oldbytes.space replied  ·  activity timestamp 7 days ago

It's been a pretty productive night in the ol' #DesmetC codebase. Regression tests finally checked in, all the mixed-size integer addition/subtraction involving signed chars I could think of is exercised and passing, nice.

Then I try i8 * i8 -> int and it instantly breaks, not so nice 🫠.
Oh well, that gives me something to fix tomorrow.

Also, I haven't ventured into floating point conversion land yet, either. I'm sure that'll have plenty of dragons when used with signed char.

All this is making me appreciate the wisdom of BCPL and B who have just a word-sized type -- or #Forth which takes that and adds char, as a treat.

#retrocomputing

List of recent commits on a GitHub pull request.

Fix promotion of i8 to long.
Tests of arithmetic.
Tests of mixed-sign arithmetic.
Remove stray prints.
Fix i8-long arithmetic.
Tests of i8-long arithmetic.
List of recent commits on a GitHub pull request. Fix promotion of i8 to long. Tests of arithmetic. Tests of mixed-sign arithmetic. Remove stray prints. Fix i8-long arithmetic. Tests of i8-long arithmetic.
List of recent commits on a GitHub pull request. Fix promotion of i8 to long. Tests of arithmetic. Tests of mixed-sign arithmetic. Remove stray prints. Fix i8-long arithmetic. Tests of i8-long arithmetic.
  • Copy link
  • Flag this comment
  • Block
psf
psf
@psf@oldbytes.space replied  ·  activity timestamp 5 days ago

Oh gosh

 MOV CL,BYTE [BP-2]
XCHG CX,AX
CBW
XCHG CX,AX
XCHG CX,AX
CBW
XCHG CX,AX
IMUL CX

When CL absolutely, positively, needs to be sign extended before multiplication blobcatthinking

  • Copy link
  • Flag this comment
  • Block
psf
psf
@psf@oldbytes.space replied  ·  activity timestamp yesterday

The mul-div codegen path in #DesmetC is sorta a nightmare because so much is reused between multiplication, division, and mod, and because there are some dodgy special-cases in here from 1990 that demonstrably do the wrong thing. Proceeding slowly with machete and torch, laying down test cases as I go.

  • Copy link
  • Flag this comment
  • Block
psf
psf
@psf@oldbytes.space replied  ·  activity timestamp 12 hours ago

Heh, well, can't imagine why the assembler doesn't like that instruction.

MOV DI, WORD 🎵«z_[+18186]
MOV DI, WORD 🎵«z_[+18186]
MOV DI, WORD 🎵«z_[+18186]
  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct