Git Product home page Git Product logo

bootlogo's Introduction

 _                 _   _
| |               | | | |
| |__   ___   ___ | |_| |     ___   __ _  ___
| '_ \ / _ \ / _ \| __| |    / _ \ / _` |/ _ \
| |_) | (_) | (_) | |_| |___| (_) | (_| | (_) |
|_.__/ \___/ \___/ \__\_____/\___/ \__, |\___/
                                __/ |
                               |___/

bootLogo interpreter in 512 bytes (boot sector or COM file)

by Oscar Toledo G. Mar/18/2024

http://nanochess.org

https://github.com/nanochess

This is a small interpreter of Logo language.

It's compatible with the 8088 processor (the original IBM PC), and it even works on CGA mode!

If you want to assemble it, you must download the Netwide Assembler (NASM) from www.nasm.us

Use this command line:

nasm -f bin bootlogo.asm -Dcom_file=1 -o bootlogo.com
nasm -f bin bootlogo.asm -Dcom_file=0 -o bootlogo.img

Tested with VirtualBox for macOS running Windows XP running this interpreter, it also works with DOSBox and probably with QEMU:

qemu-system-x86_64 -fda bootlogo.img

You can set also the following labels:

  • video_mode. This sets the video mode used for bootLogo (default = 4 for CGA mode 320x200x4 colors). A good alternative is 13 (EGA/VGA 320x200x16 mode).
  • color1. This sets the color for the letters in the command line (default = 1 for CGA mode)
  • color2. This sets the color for line drawing (default = 3 for CGA mode)

Enjoy it!

User's manual

Line entry is done with the keyboard, finish the line with Enter.

Backspace can be used to correct mistakes.

The following commands are implemented:

CLEARSCREEN

Clears the screen and returns the turtle to the center, and pointing to the north. This command can only be used alone.

FD 40

Move the turtle 40 pixels ahead. Caveat: If you use zero, it will be taken as 65536 pixels.

BK 40

Move the turtle 40 pixels backward. Caveat: If you use zero, it will be taken as 65536 pixels.

RT 25

Rotate the turtle 25 degrees clockwise.

LT 25

Rotate the turtle 25 degrees counterclockwise.

REPEAT 10 FD 10

Repeat 10 times FD 10

REPEAT 10 [FD 10 RT 20]

Repeat 10 times FD 10 RT 20. REPEAT can be nested. If you somehow miss the final ] character then bootLogo will crash.

PU

Pen up. The turtle doesn't draw for following commands.

PD

Pen down. The turtle draws again.

SETCOLOR 2

Set color for pen. Only 0-3 available in CGA, and 0-15 for EGA/VGA.

TO [name] [command or list of commands] END

This command allows you to define procedures. All the definition should fit inside one line (120 characters).

A single command could be a REPEAT. Several commands can be grouped using [ and ].

Only the two first letters of the name are taken in account. The predefined commands have priority (so you cannot define them out). Also, once defined a procedure, it cannot be edited again (sorry, lack of space).

For example:

TO CURVE REPEAT 4 [LT 10 FD 10] END
TO PETAL [CURVE LT 140 CURVE] END
TO FLOWER REPEAT 4 [PETAL LT 50] END
FLOWER
RT 180
FD 50
RT 140
PETAL
PU
FD 50

QUIT

Exit to command line (only .COM version)

Examples

bootLogo command sequence

Result of bootLogo command sequence

Acknowledgments

  • jcmeyrignac for an idea to make smaller the number decoding.
  • Jim Leonard (MobyGamer) for making me thinking about a higher-precision sin function, and suggesting me the use of the Set Pixel BIOS service.
  • raulamd for reminding me that cubicDoom had a smaller sin function.

More on this?

Do you want to learn 8086/8088 assembler? Get my book Programming Boot Sector Games containing an 8086/8088 crash course!

Now available from Lulu:

Paperback book

Hard-cover book

eBook

These are some of the example programs documented profusely in the book:

  • Guess the number.
  • Tic-Tac-Toe game.
  • Text graphics.
  • Mandelbrot set.
  • F-Bird game.
  • Invaders game.
  • Pillman game.
  • Toledo Atomchess.
  • bootBASIC language.

bootlogo's People

Contributors

nanochess avatar easybe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar Elmurod Torayev avatar Rudá Moura avatar Ziggy avatar Martin Chtilianov avatar Andrin Bertschi avatar  avatar  avatar Alireza avatar Braden Farmer avatar  avatar  avatar Ryan James Spencer avatar Cedric Guillemet avatar Ercan Ersoy avatar Delian Delchev avatar 爱可可-爱生活 avatar Matheus Moreira avatar Aiekick avatar Neos21 avatar Rodolfo avatar Massimiliano Monaro avatar ismakubex avatar Henrik Westphal avatar Jinyi avatar Tim Smith avatar  avatar satler avatar Eli Bird avatar Bojidar Marinov avatar  avatar Rémi Marche avatar karyo avatar  avatar Theron Spiegl avatar chai2010 avatar Alexander Pushkov avatar keke avatar alwayrun avatar coderock avatar  avatar  avatar Andrew Elgert avatar Osvaldo Santana Neto avatar Byungjun Lee avatar 江天文 avatar David Buchanan avatar Tripp avatar Onur /oh-noor/ avatar Oleg Zaytsev avatar  avatar  avatar Dylan McDonald avatar Eigengrau avatar Bruno De Backer avatar  avatar  avatar Kalin Kochnev avatar Kanishk Tiwari avatar  avatar Barrett Otte avatar  avatar Gordon JC Pearce avatar Lukas Šalkauskas avatar Elijah ben Izzy avatar Devine Lu Linvega avatar  avatar huntergdavis avatar Ian Smith avatar atejeda avatar Andrew Woods avatar Alessandro Iob avatar John Efemer avatar Wei Yichen avatar Ivan Kuzmenko avatar André Machado avatar Mtv Europe avatar  avatar Maurício Witter avatar 万里 avatar Jason Huang avatar Danila Poyarkov avatar Alex Myczko avatar  avatar  avatar Jimmy Ruska avatar  avatar Zephyr Lykos avatar Anggra Alhera Nasmita Utomo avatar Dustin Miller avatar Brian Jorgensen avatar Carl Wiedemann avatar Hugo Rivera Calzadillas avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bootlogo's Issues

tricks to make the sin table shorter

1 -Exploiting symmetries, for example, the first half of the table is minus the second half.
2- Generate a sin table like 4K demos do using a recurrence formula (just a few instructions)

Good job!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.