about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-16 07:55:07 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-16 07:55:07 -0700
commitb8cfbdc866c6a10dd057b94b6bb161c8aa382b00 (patch)
treed0573b08689b3f8608d191d203b035abad0526eb /subx
parent1f56ac6483f97ab18245c69c8c006be158c18a8d (diff)
downloadmu-b8cfbdc866c6a10dd057b94b6bb161c8aa382b00.tar.gz
4351
Diffstat (limited to 'subx')
-rw-r--r--subx/Readme.md15
-rw-r--r--subx/ex1.1.subx1
-rw-r--r--subx/ex1.2.subx1
-rw-r--r--subx/html/ex1.pngbin0 -> 140501 bytes
4 files changed, 17 insertions, 0 deletions
diff --git a/subx/Readme.md b/subx/Readme.md
index 8ed47deb..cdfb1f06 100644
--- a/subx/Readme.md
+++ b/subx/Readme.md
@@ -49,6 +49,21 @@ Running `subx` will transparently compile it as necessary.
   translate`. Useful for debugging, and also enables more thorough testing of
   `translate`.
 
+Putting them together, build and run one of the example programs:
+
+<img alt='ex1.1.subx' src='html/ex1.png'>
+
+```
+$ ./subx translate ex1.1.subx ex1
+$ ./subx run ex1
+```
+
+If you're running on Linux, `ex1` will also be runnable directly:
+```
+$ chmod +x ex1
+$ ./ex1
+```
+
 I'm not building general infrastructure here for all of the x86 ISA and ELF
 format. SubX is about programming with a small, regular subset of 32-bit x86:
 
diff --git a/subx/ex1.1.subx b/subx/ex1.1.subx
index 6b601926..220af79e 100644
--- a/subx/ex1.1.subx
+++ b/subx/ex1.1.subx
@@ -1,4 +1,5 @@
 ## first program: same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
+# Just return 42.
 #
 # To run:
 #   $ subx translate ex1.1.subx ex1
diff --git a/subx/ex1.2.subx b/subx/ex1.2.subx
index 03b7ea9c..81f2bfe2 100644
--- a/subx/ex1.2.subx
+++ b/subx/ex1.2.subx
@@ -1,4 +1,5 @@
 ## first program: same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
+# Just return 42.
 #
 # To run:
 #   $ subx translate ex1.2.subx ex1
diff --git a/subx/html/ex1.png b/subx/html/ex1.png
new file mode 100644
index 00000000..c491c471
--- /dev/null
+++ b/subx/html/ex1.png
Binary files differ
d='n219' href='#n219'>219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381