From 8d8a75acec02f884dbb8ebbe24eac065cbeed677 Mon Sep 17 00:00:00 2001 From: Jan Vrany Date: Thu, 15 Jun 2023 22:23:21 +0100 Subject: [PATCH] Print constants of type `Address` in hex --- src/Tinyrossa/TRILNodePrinter.class.st | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Tinyrossa/TRILNodePrinter.class.st b/src/Tinyrossa/TRILNodePrinter.class.st index fc58864..33f67f9 100644 --- a/src/Tinyrossa/TRILNodePrinter.class.st +++ b/src/Tinyrossa/TRILNodePrinter.class.st @@ -49,8 +49,14 @@ TRILNodePrinter >> print: node on: aStream [ (opcode hasSymbolRef or:[opcode isBranch]) ifTrue: [ aStream nextPutAll: node symbol name ] ifFalse: [ - opcode isLoadConst ifTrue: [ - node constant printOn: aStream. + opcode isLoadConst ifTrue: [ + node type == 1 ifTrue: [ + aStream + nextPutAll: '0x'; + nextPutAll: ( node constant printPaddedWith: $0 to: 16 base: 16). + ] ifFalse: [ + node constant printOn: aStream. + ] ]. ]. ].