mirror of
https://github.com/romychs/Ocean-240.2-Emulator.git
synced 2026-11-02 04:37:09 +03:00
Redo main cycle
This commit is contained in:
1 parent
c1616dfbd6
commit
a74841b048
11 files changed
+434
-139
No files matched your search
@@ -34,7 +34,7 @@ var orMatch = regexp.MustCompile(`\s+OR\s+`)
|
||||
|
||||
// var xorMatch = regexp.MustCompile(`\s+XOR\s+`)
|
||||
var hexHMatch = regexp.MustCompile(`[[:xdigit:]]+H`)
|
||||
var eqMatch = regexp.MustCompile(`[^=><]=[^=]`)
|
||||
var eqMatch = regexp.MustCompile(`[^=><!]=[^=]`)
|
||||
|
||||
func patchExpression(expr string) string {
|
||||
ex := strings.ToUpper(expr)
|
||||
@@ -58,6 +58,8 @@ func patchExpression(expr string) string {
|
||||
break
|
||||
}
|
||||
}
|
||||
ex = strings.ReplaceAll(ex, "NOT", "!")
|
||||
ex = strings.ReplaceAll(ex, "<>", "!=")
|
||||
return ex
|
||||
}
|
||||
|
||||
|
||||
@@ -5,13 +5,14 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
const expr1 = "PC=00100h && SP>=256"
|
||||
const expr1 = "PC=00100h and (NOT(B > 10)) and a != 5"
|
||||
const expr2 = "PC=00115h"
|
||||
const expr3 = "SP>=1332"
|
||||
|
||||
var ctx = map[string]interface{}{
|
||||
"PC": 0x100,
|
||||
"A": 0x55,
|
||||
"B": 5,
|
||||
"SP": 0x200,
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user