--- title: "A New FORMAT" type: "article" slug: "a-new-format" url: "http://localhost/article/a-new-format/" markdown_url: "http://localhost/article/a-new-format.md" published_at: "2026-11-11T11:07:09+00:00" modified_at: "2026-11-11T11:07:09+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "FORMAT_BIN, a public-domain 68000 SuperBASIC extension by Réal Gagnon (November 1989) that redefines the dangerous FORMAT command: the medium name must now be given in quotes, a warning appears, and formatting starts only when F1 is pressed. It works on QLs with JS or JSU ROMs. The program can be ordered from QL_DOC for $4 plus a medium, created with the given SuperBASIC loader and DATA lines, or assembled from the listed source with an assembler such as Metacomco's." post_tag: - name: "French language" slug: "french-language" taxonomy: "post_tag" url: "http://localhost/tag/french-language/" - name: "Machine language programming" slug: "machine-language" taxonomy: "post_tag" url: "http://localhost/tag/machine-language/" - name: "Public Domain Software" slug: "public-domain-software" taxonomy: "post_tag" url: "http://localhost/tag/public-domain-software/" - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" - name: "Superbasic (programming language)" slug: "superbasic-programming-language" taxonomy: "post_tag" url: "http://localhost/tag/superbasic-programming-language/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" indiv: - name: "Real Gagnon" slug: "real-gagnon" taxonomy: "indiv" url: "http://localhost/indiv/real-gagnon/" publication: "QL_DOC" publication_r: id: 52925 title: "QL_DOC" type: "periodical" url: "http://localhost/periodical/ql_doc/" authors: "Réal Gagnon" issue: "13" issues_articles: - id: 76730 title: "QL_DOC n13" type: "issue" url: "http://localhost/issue/ql_doc-n13/" pages: "4-7" pubdate: "December 1989-January 1990" archive_link: false volumeissue: "n13" --- # A New FORMAT **In English:** FORMAT_BIN, a public-domain 68000 SuperBASIC extension by [Réal Gagnon](http://localhost/indiv/real-gagnon/) (November 1989) that redefines the dangerous FORMAT command: the medium name must now be given in quotes, a warning appears, and formatting starts only when F1 is pressed. It works on QLs with JS or JSU ROMs. The program can be ordered from QL_DOC for $4 plus a medium, created with the given SuperBASIC loader and DATA lines, or assembled from the listed source with an assembler such as [Metacomco](http://localhost/company/metacomco/)'s. *Printed title: Nouveau FORMAT. The article below is in French, as printed in QL_DOC n13 (December 1989-January 1990).* *** La commande FORMAT est très dangereuse, elle commence immédiatement son travail sans nous avertir qu’elle va tout effacé sur son passage. Parce que j’ai déjà perdu des trucs en formatant la mauvaise cartouche, j’ai écrit ce petit programme qui redéfinit la commande FORMAT pour la rendre plus sécuritaire. En effet, la nouvelle syntaxe de la commande FORMAT nous oblige à mettre des guillemets maintenant: FORMAT mdv1_ n’est plus valide, FORMAT “mdv1_” est acceptable. Si le paramètre est accepté, un message nous avertissant du danger emminent apparait et on nous demande d’appuyer sur la touche F1 pour débuter le formatage ou bien de faire F2 pour annuler la procédure. En réalité, seule la touche F1 fera débuter le formatage, toutes les autres annuleront l’opération. On charge le programme de cette façon: ``` a= RESPR(256) LBYTES xxxx_FORMAT_BIN,a CALL a ``` ou xxxx est le support qui contient le fichier FORMAT_BIN. A partir de ce moment, la nouvelle syntaxe de la commande FORMAT est en vigueur. Le canal #0 se doit d’être ouvert, si il est fermé, on ne verra pas les indications à l’écran. FORMAT_BIN fonctionne sur des QLs équippé avec la ROM JS ou JSU. Il y a 3 façons d’obtenir ce programme. 1- Envoyer 4$ plus le support (mdv/5.25″/3.5″) sur lequel vous voulez recevoir FORMAT_BIN à QL_DOC. 2- Taper le programme SuperBASIC suivant qui va créer le fichier FORMAT_BIN. 3- Taper le programme source assembleur et compiler-le avec un assembleur quelconque, Metacomco MASM par exemple. ### PROGRAMME SuperBASIC POUR CREER FORMAT_BIN ``` 100 REMark CHARGEUR_BAS 110 REMark pour QL_DOC 120 : 130 INPUT "Où sauver les codes (ex. flp1_)?";sauve$ 140 IF LEN(sauve$)=0:sauve$="flp1_" 150 PRINT "Un instant s.v.p."; 160 : 170 RESTORE 1000 180 memoire=RESPR(1000):base_memoire=memoire 190 compte=0 200 : 210 REPeat boucle 220 IF EOF:EXIT boucle 230 READ octet:POKE memoire,octet:memoire=memoire+1 240 compte=compte+1 250 PRINT "."; 260 END REPeat boucle 270 : 280 DELETE sauve$&"format_bin" 290 SBYTES sauve$&"format_bin",base_memoire,compte 300 PRINT "Terminé!" 1000 DATA 67, 250, 0, 10, 52, 120, 1, 16, 78, 146 1001 DATA 78, 117, 0, 1, 0, 16, 6, 70, 79, 82 1002 DATA 77, 65, 84, 0, 0, 0, 0, 0, 0, 0 1003 DATA 52, 120, 1, 22, 78, 146, 74, 128, 102, 86 1004 DATA 112, 241, 182, 124, 0, 1, 102, 78, 211, 206 1005 DATA 47, 9, 145, 200, 54, 120, 0, 208, 78, 147 1006 DATA 67, 250, 0, 78, 78, 147, 112, 0, 78, 65 1007 DATA 54, 40, 0, 138, 56, 40, 0, 138, 184, 67 1008 DATA 103, 248, 184, 124, 0, 232, 32, 95, 102, 36 1009 DATA 112, 3, 78, 66, 74, 128, 102, 40, 47, 2 1010 DATA 145, 200, 54, 120, 0, 206, 78, 147, 67, 250 1011 DATA 0, 84, 54, 120, 0, 208, 78, 147, 34, 31 1012 DATA 54, 120, 0, 206, 78, 147, 145, 200, 67, 250 1013 DATA 0, 104, 54, 120, 0, 208, 78, 147, 78, 117 1014 DATA 0, 52, 32, 115, 101, 114, 97, 32, 70, 79 1015 DATA 82, 77, 65, 84, 69, 32, 101, 116, 32, 69 1016 DATA 70, 70, 65, 67, 69, 33, 32, 10, 32, 32 1017 DATA 32, 70, 49, 46, 46, 46, 32, 79, 117, 105 1018 DATA 32, 32, 32, 70, 50, 46, 46, 46, 32, 78 1019 DATA 111, 110, 32, 10, 0, 38, 32, 115, 101, 99 1020 DATA 116, 101, 117, 114, 115, 32, 66, 79, 78, 83 1021 DATA 32, 115, 117, 114, 32, 117, 110, 101, 32, 112 1022 DATA 111, 115, 115, 105, 98, 105, 108, 105, 116, 131 1023 DATA 32, 100, 101, 32, 0, 11, 10, 84, 101, 114 1024 DATA 109, 105, 110, 131, 46, 32, 10, 0 ``` ``` ** Liste du programme assembleur de FORMAT_BIN ** CE PROGRAMME APPARTIENT AU DOMAINE PUBLIC ** ************************************** * FORMAT alternatif v.1 * * * * novembre 1989 * * par Réal Gagnon * * Montréal, Québec * ************************************** ERR_BP equ -15 erreur BAD PARAMETER IO_FORMT equ 3 routine QDOS format BP_INIT equ $110 * QDOS initialisation extension CA_GTSTR equ $116 * QDOS passage de paramètre (string) UT_MTEXT equ $D0 * QDOS imprime message à l'écran UT_MINT equ $CE * QDOS imprime un entier à l'écran MT_INF equ 0 * QDOS reoturne la base des Sys.Var. SV_ARBUF equ $8A Sys.Var. indiquant la dernière touche pressée DEFPROC lea.l PROC,a1 initialisation de la nouvelle commande FORMAT move.w BP_INIT,a2 jsr (a2) rts PROC dc.w 1 nombre de procédure à définir dc.w FORMAT-* dc.b 6 dc.b 'FORMAT' dc.w 0 fin des procédures dc.w 0 nombre de fonction à définir dc.w 0 fin des fonctions FORMAT move.w CA_GTSTR,a2 va chercher paramètre jsr (a2) tst.l d0 bne.s fin sortie si erreur moveq #ERR_BP,d0 cmp.w #1,d3 vérifie si il y a un seul paramètre bne.s fin si non sortie avec BAD PARAMETER adda.l a6,a1 move.l a1,-(sp) sauve A1 (dessus de pile) * Içi (A6.A1 qui sauvé sur la pile) contient * le nom du périphérique sous la forme: * 2 octets=longueur * le reste=le nom du "device" à FORMATer. ATTENTION suba.l a0,a0 imprime un message à l'écran (CANAL#0) move.w UT_MTEXT,a3 impression du "device" (A1) jsr (a3) lea.l MESSAGE1,a1 jsr (a3) moveq #MT_INF,d0 trap #1 A0=base des systèmes variables move.w SV_ARBUF(a0),d3 BOUCLE move.w SV_ARBUF(a0),d4 attend une nouvelle touche cmp.w d3,d4 beq.s BOUCLE cmp.w #$E8,d4 nouvelle touche = F1? FMT_DSK move.l (sp)+,a0 A0 pointe vers la pile=nom du "device" bne.s FIN moveq #IO_FORMT,d0 routine QDOS FORMAT trap #2 tst.l d0 bne.s DEPART * D1.W = nbre bon secteur * D2.W = nbre total secteur move.l d2,-(sp) sauve D2 sur la pile suba.l a0,a0 move.w UT_MINT,a3 impression du nombre de secteur OK jsr (a3) lea.l MESSAGE2,a1 move.w UT_MTEXT,a3 jsr (a3) move.l (sp)+,d1 sur une possibilité de ... move.w UT_MINT,a3 jsr (a3) FIN suba.l a0,a0 lea.l OK,a1 message de sortie move.w UT_MTEXT,a3 jsr (a3) DEPART rts MESSAGE1 dc.w $34 dc.b ' sera FORMATE et EFFACE! ',$0A dc.b ' F1... Oui F2... Non ',$0A MESSAGE2 dc.w $26 dc.b ' secteurs BONS sur une possibilité de ' OK dc.w $0B dc.b $0A,'Terminé. ',$0A end ```